// ============================== 导入依赖 ============================== //

import API_DELIVER from '@admin/views/Maintain/Deliver/DeliverWorker/store/API'
import API_WEB from '@admin/views/System/User/UserList/store/API'
import API_APP from './API_APP'

// ============================== 导出异步调用 ============================== //

export default {
  // —————————————————————————————— 列表 —————————————————————————————— //

  async remoteList({ state: { API, MAP, param, info } }) {
    param.organId = !param.organId ? [] : param.organId

    if (param.scope && !param.organId.length) return [0, []]

    const MY_API = info.deliver ? API_DELIVER : param.scope === 1 ? API_APP : API_WEB
    const TIP = API.transTip(MAP.tipList)
    const [num, arr] = await MY_API.getList(param, TIP)
    return [num, arr]
  },
}
